package com.smart.web.controller;

import java.util.ArrayList;
import java.util.List;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import com.smart.consts.AppStatusData;
import com.smart.model.User;
import com.smart.model.base.JsonModel;

@Controller
public class TestController extends BaseController {
	@RequestMapping("loanShop/app/getAdmins")
	public void getAdminList(HttpServletRequest request, HttpServletResponse response, @RequestParam String data) {
		JsonModel jsonModel = new JsonModel();
		AppStatusData statusObject = null;
		List<User> list = new ArrayList<User>();
		if (requestHandle(data, jsonModel,statusObject)) {
			statusObject = new AppStatusData("0", "ok");
			list = userService.findAll();
			returnJson(response, statusObject, list);
		}
		returnJson(response, jsonModel);
	}
}
